define(['common/menu.m', 'example.m'], 
	function(MenuManager, ExampleManager) {

		/*Define 'core/boilerplate' dependency to access Boilerplate*/

	    var Game = function(Config) {
			/*Construct Game Controler*/
			this.stop = true;
			this.pause = false;
			this.currentTime = +new Date();
			this.secondsElapsed = 0;
			this.parent = Config.parent !== undefined ? Config.parent : false;
		}

		Game.prototype = {
			init : function() {
				/*Initialize game managers*/
				var that = this;
				MenuManager.init('HTML');

				ExampleManager.init(1);

				window.onresize = function(){
					that.parent.scene.setSize();
					MenuManager.resize();
					ExampleManager.resize();
				};
			},				
			update : function() {
				if(ExampleManager.isStarted === false) {
					ExampleManager.start()	
				}
				/*Game loop - Update game managers*/
				ExampleManager.update();
				MenuManager.update();
			},
			render : function() {

				alpha(this, this.parent.scene.ctx, 30, function(that) {
					// Render Scene
					drawRect(that.parent.scene.ctx,that.parent.conf.colors.grey,0,0,that.parent.scene.width,that.parent.scene.height);
				});			

				ExampleManager.render();			
				MenuManager.render();
			},
			gameOver : function() {
				this.stop = true;
			},
			reset : function() {
			},
		}

		// Save Managers
		for(var iA = 0, cA = arguments.length; iA < cA; iA++) {
			// Get alias for argument
			var argument = arguments[iA];
			// Has model so is manager
			if(argument.model !== undefined) {
				var model = argument.model.prototype.name;
				Game.prototype[model+"Manager"] = argument;
			}
		}

		return Game;
	}
);